# coding=utf-8
import MySQLdb

conn = MySQLdb.connect(
    host='localhost',
    port=3306,
    user='root',
    passwd='123456',
    db='test',
)
cur = conn.cursor()
# 插入一条数据
sql = "insert into student values(%s,%s,%s,%s)"
cur.execute(sql, ('3', 'Huhu', '2 year 1 class', '7'))

cur.close()
conn.commit()
conn.close()
